package com.ruoyi.project.system.trick.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.trick.mapper.VerbalTrickMapper;
import com.ruoyi.project.system.trick.domain.VerbalTrick;
import com.ruoyi.project.system.trick.service.IVerbalTrickService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 话术Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-19
 */
@Service
public class VerbalTrickServiceImpl implements IVerbalTrickService 
{
    @Autowired
    private VerbalTrickMapper verbalTrickMapper;


    @Override
    public VerbalTrick selectVerbalTrickByEquipmentIdAndUserName(Long equipmentId, String userName) {
        return verbalTrickMapper.selectVerbalTrickByEquipmentIdAndUserName(equipmentId,userName);
    }

    @Override
    public VerbalTrick selectDataStateByVerbalTrick(String verbalTrick) {
        return verbalTrickMapper.selectDataStateByVerbalTrick(verbalTrick);
    }

    @Override
    public VerbalTrick selectByEquipmentIdAndUserName(Long equipmentId, String userName) {
        return verbalTrickMapper.selectByEquipmentIdAndUserName(equipmentId,userName);
    }

    @Override
    public int insertEquipmentIdAndUserNameAndWechatId(Long equipmentId, String userName, String wechatId) {
        return verbalTrickMapper.insertEquipmentIdAndUserNameAndWechatId(equipmentId,userName,wechatId);
    }

    @Override
    public int deleteFileByEquipmentIdAndUserName(Long equipmentId, String userName) {
        return verbalTrickMapper.deleteFileByEquipmentIdAndUserName(equipmentId,userName);
    }


    /**
     * 查询话术
     * 
     * @param id 话术主键
     * @return 话术
     */
    @Override
    public VerbalTrick selectVerbalTrickById(Long id)
    {
        return verbalTrickMapper.selectVerbalTrickById(id);
    }

    /**
     * 查询话术列表
     * 
     * @param verbalTrick 话术
     * @return 话术
     */
    @Override
    public List<VerbalTrick> selectVerbalTrickList(VerbalTrick verbalTrick)
    {
        return verbalTrickMapper.selectVerbalTrickList(verbalTrick);
    }

    /**
     * 新增话术
     * 
     * @param verbalTrick 话术
     * @return 结果
     */
    @Override
    public int insertVerbalTrick(VerbalTrick verbalTrick)
    {
        return verbalTrickMapper.insertVerbalTrick(verbalTrick);
    }

    /**
     * 修改话术
     * 
     * @param verbalTrick 话术
     * @return 结果
     */
    @Override
    public int updateVerbalTrick(VerbalTrick verbalTrick)
    {
        return verbalTrickMapper.updateVerbalTrick(verbalTrick);
    }

    /**
     * 批量删除话术
     * 
     * @param ids 需要删除的话术主键
     * @return 结果
     */
    @Override
    public int deleteVerbalTrickByIds(String ids)
    {
        return verbalTrickMapper.deleteVerbalTrickByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除话术信息
     * 
     * @param id 话术主键
     * @return 结果
     */
    @Override
    public int deleteVerbalTrickById(Long id)
    {
        return verbalTrickMapper.deleteVerbalTrickById(id);
    }
}
